#include"../../common/logger.hpp"

void sync()
{
    // auto sync_stdout = spdlog::stdout_color_mt("multi_sink_example");
    // sync_stdout->set_level(spdlog::level::debug); 
    // sync_stdout->set_pattern("[%Y-%m-%d %H:%M:%S] [%l] [%v]");
    // sync_stdout->debug("hehe");

    auto sync_file = spdlog::basic_logger_mt("multi_sink_example","test.log");
    sync_file->set_level(spdlog::level::debug); 
    sync_file->set_pattern("[%Y-%m-%d %H:%M:%S] [%l] [%v]");
    sync_file->debug("hehe");
}

void async()
{
    auto async_stdout = spdlog::stdout_color_mt<spdlog::async_factory> ("multi_sink_example");
    async_stdout->set_level(spdlog::level::debug); 
    async_stdout->set_pattern("[%Y-%m-%d %H:%M:%S] [%l] [%v]");
    async_stdout->debug("hehe");
    std::cout<<"00000"<<std::endl;
}

void test_logger()
{
    InitLog(true,"./main.log");
    LOG_DEBUG("nihao"); 
    LOG_INFO("nihao:{}","xuzhengyou");
    LOG_WARN("nihao");
    LOG_ERROR("nihao");
}




int main()
{
    //sync();
    //async();
    //multi_sink_example();
    test_logger();
    return 0;
}